<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title></title>
	<script src="https://webapi.amap.com/maps?v=1.4.15&key=9667421e67b4a29e2adb66ac5c59d203"></script>
	<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
	<script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.1.js"></script>
</head>
<body>
	<div class="container">
		
	</div>
	<script type="text/javascript">
		document.addEventListener('UniAppJSBridgeReady', function() {
			var map = new AMap.Map('container', {
				resizeEnable: true
			})
			map.plugin('AMap.Geolocation', function() {
				var geolocation = new AMap.Geolocation({
					// 是否使用高精度定位，默认：true
					enableHighAccuracy: true,
					// 设置定位超时时间，默认：无穷大
					timeout: 10000,
					// 定位按钮的停靠位置的偏移量，默认：Pixel(10, 20)
					buttonOffset: new AMap.Pixel(10, 20),
					//  定位成功后调整地图视野范围使定位位置及精度范围视野内可见，默认：false
					zoomToAccuracy: true,     
					//  定位按钮的排放位置,  RB表示右下
					buttonPosition: 'RB'
				})
			
				geolocation.getCurrentPosition()
				AMap.event.addListener(geolocation, 'complete', onComplete)
				AMap.event.addListener(geolocation, 'error', onError)
			
				function onComplete (res) {
					uni.postMessage({
						data: {
							action: res
						}
					});
				}
				function onError (res) {
					
				}
			})
		});
	</script>
</body>
</html>